package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 
 * @TableName trace
 */
@TableName(value ="trace")
@Data
public class Trace implements Serializable {


    /**
     * 食物的id
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 铁
     */
    @TableField(value = "Iron")
    private Double iron;

    /**
     * 碘
     */
    @TableField(value = "Iodine")
    private Double iodine;

    /**
     * 钾
     */
    @TableField(value = "Potassium")
    private Double potassium;

    /**
     * 镁
     */
    @TableField(value = "Magnesium")
    private Double magnesium;

    /**
     * 铜
     */
    @TableField(value = "Copper")
    private Double copper;

    /**
     * 磷
     */
    @TableField(value = "Phosphorus")
    private Double phosphorus;

    /**
     * 锌
     */
    @TableField(value = "Zinc")
    private Double zinc;

    /**
     * 硒
     */
    @TableField(value = "Selenium")
    private Double selenium;

    /**
     * 叶酸
     */
    @TableField(value = "Folate")
    private Double folate;

    /**
     * 钙
     */
    @TableField(value = "Calcium")
    private Double calcium;

    /**
     * 钴
     */
    @TableField(value = "Cobalt")
    private Double cobalt;

    /**
     * 钠
     */
    @TableField(value = "Sodium")
    private Double sodium;

    /**
     * 锰
     */
    @TableField(value = "Manganese")
    private Double manganese;

    /**
     * 硫
     */
    @TableField(value = "Sulfur")
    private Double sulfur;

    /**
     * 硅
     */
    @TableField(value = "Silicon")
    private Double silicon;

    /**
     * 创建时间
     */
    @TableField(value = "create_Time")
    private LocalDateTime createTime;

    /**
     * 更改时间
     */
    @TableField(value = "update_Time")
    private LocalDateTime updateTime;

    /**
     * 0为删除
     */
    @TableLogic
    @TableField(value = "is_Delete")
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Trace other = (Trace) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getIron() == null ? other.getIron() == null : this.getIron().equals(other.getIron()))
            && (this.getIodine() == null ? other.getIodine() == null : this.getIodine().equals(other.getIodine()))
            && (this.getPotassium() == null ? other.getPotassium() == null : this.getPotassium().equals(other.getPotassium()))
            && (this.getMagnesium() == null ? other.getMagnesium() == null : this.getMagnesium().equals(other.getMagnesium()))
            && (this.getCopper() == null ? other.getCopper() == null : this.getCopper().equals(other.getCopper()))
            && (this.getPhosphorus() == null ? other.getPhosphorus() == null : this.getPhosphorus().equals(other.getPhosphorus()))
            && (this.getZinc() == null ? other.getZinc() == null : this.getZinc().equals(other.getZinc()))
            && (this.getSelenium() == null ? other.getSelenium() == null : this.getSelenium().equals(other.getSelenium()))
            && (this.getFolate() == null ? other.getFolate() == null : this.getFolate().equals(other.getFolate()))
            && (this.getCalcium() == null ? other.getCalcium() == null : this.getCalcium().equals(other.getCalcium()))
            && (this.getCobalt() == null ? other.getCobalt() == null : this.getCobalt().equals(other.getCobalt()))
            && (this.getSodium() == null ? other.getSodium() == null : this.getSodium().equals(other.getSodium()))
            && (this.getSulfur() == null ? other.getSulfur() == null : this.getSulfur().equals(other.getSulfur()))
            && (this.getSilicon() == null ? other.getSilicon() == null : this.getSilicon().equals(other.getSilicon()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getIron() == null) ? 0 : getIron().hashCode());
        result = prime * result + ((getIodine() == null) ? 0 : getIodine().hashCode());
        result = prime * result + ((getPotassium() == null) ? 0 : getPotassium().hashCode());
        result = prime * result + ((getMagnesium() == null) ? 0 : getMagnesium().hashCode());
        result = prime * result + ((getCopper() == null) ? 0 : getCopper().hashCode());
        result = prime * result + ((getPhosphorus() == null) ? 0 : getPhosphorus().hashCode());
        result = prime * result + ((getZinc() == null) ? 0 : getZinc().hashCode());
        result = prime * result + ((getSelenium() == null) ? 0 : getSelenium().hashCode());
        result = prime * result + ((getFolate() == null) ? 0 : getFolate().hashCode());
        result = prime * result + ((getCalcium() == null) ? 0 : getCalcium().hashCode());
        result = prime * result + ((getCobalt() == null) ? 0 : getCobalt().hashCode());
        result = prime * result + ((getSodium() == null) ? 0 : getSodium().hashCode());
        result = prime * result + ((getSulfur() == null) ? 0 : getSulfur().hashCode());
        result = prime * result + ((getSilicon() == null) ? 0 : getSilicon().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", iron=").append(iron);
        sb.append(", iodine=").append(iodine);
        sb.append(", potassium=").append(potassium);
        sb.append(", magnesium=").append(magnesium);
        sb.append(", copper=").append(copper);
        sb.append(", phosphorus=").append(phosphorus);
        sb.append(", zinc=").append(zinc);
        sb.append(", selenium=").append(selenium);
        sb.append(", folate=").append(folate);
        sb.append(", calcium=").append(calcium);
        sb.append(", cobalt=").append(cobalt);
        sb.append(", sodium=").append(sodium);
        sb.append(", sulfur=").append(sulfur);
        sb.append(", silicon=").append(silicon);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}